Automated cell counting for Trypan blue-stained cell cultures using machine learning

Cell counting is a vital practice in the maintenance and manipulation of cell cultures. It is a crucial aspect of assessing cell viability and determining proliferation rates, which are integral to maintaining the health and functionality of a culture. Additionally, it is critical for establishing the time of infection in bioreactors and monitoring cell culture response to targeted infection over time. However, when cell counting is performed manually, the time involved can become substantial, particularly when multiple cultures need to be handled in parallel. Automated cell counters, which enable significant time reduction, are commercially available but remain relatively expensive. Here, we present a machine learning (ML) model based on YOLOv4 that is able to perform cell counts with a high accuracy (>95%) for Trypan blue-stained insect cells. Images of two distinctly different cell lines, Trichoplusia ni (High FiveTM; Hi5 cells) and Spodoptera frugiperda (Sf9), were used for training, validation, and testing of the model. The ML model yielded F1 scores of 0.97 and 0.96 for alive and dead cells, respectively, which represents a substantially improved performance over that of other cell counters. Furthermore, the ML model is versatile, as an F1 score of 0.96 was also obtained on images of Trypan blue-stained human embryonic kidney (HEK) cells that the model had not been trained on. Our implementation of the ML model comes with a straightforward user interface and can image in batches, which makes it highly suitable for the evaluation of multiple parallel cultures (e.g. in Design of Experiments). Overall, this approach for accurate classification of cells provides a fast, bias-free alternative to manual counting.


Reviewer comments:
Reviewer #1 We thank the reviewer for the positive evaluation of our protocol manuscript.We have revised the manuscript to accommodate the points raised.
The authors present ML-based application for automated cell counting that provides high accuracy at low cost.This research is significant since manual count using traditional approaches such as hemocytometer is often unreliable and not reproducible as results may vary when analyzed by different operators.The manual binary classification live or dead is often hard to make since sometimes cells are not just "white" and "blue" but in between and some operators may call it live and some dead.I appreciate the efforts done by the authors of this manuscript since they are aimed to solve a problem for counting insect cells that lack quantitative and reliable tools.They also aim to avoid buying expensive technology, which is highly valuable.Overall, the work presented is technically sound and promising.I only have concerns that they seemed to verify their model using manual human visual approach which they criticized themselves.I think their manuscript deserves publication, but needs to address at least the following: 1) how many operators verified the model manually and if there was 100% consensus or not, Response: Please see point 4 under suggestions/major concerns, below.
2) It seems that there are out-of-focus cells in the pictures.Could a different, thinner chamber be used to make sure all the cells are in the same focus plane?Response: We appreciate the reviewer's perceptive observations made regarding the images showcased in the paper.However, we would like to clarify that the scenario described by the reviewer does not apply to the images shown.All the cells present in the chambers are in the same focal plane.What the reviewer interprets as out-of-focus cells are actually artifacts that result from contamination on the microscope (scratches/dust/etc.).We deliberately retained this data in the images, recognizing it as an opportunity to assess the capacity of the machine learning algorithm to potentially misclassify such instances.
To clarify this point, we have added the following sentence at line 278 of the revised manuscript: "Additionally, anomalies originating from microscope contamination, such as scratches or dust, were not classified as cells." 3) It would be best if they tested or trained control samples, dead cell control sample, for example, is easy to prepare, since they can use heat-shock or fixation protocols to produce stable dead cells.I think this is far more important than mixing cultures, though, I appreciate the value of the mixed cell population as well.Response: Please see point 3 under suggestions/major concerns, below.
4) It seems that model can be improved by training close to equal # of live and dead cells to avoid issues discussed in the manuscript (model was able to detect alive cells better than dead cells).Why was it not done if they recognized the issue?Response: Please see point 4 under suggestions/major concerns, below.5) I was not clear if their approach solved the aggregation problem.It seems that it did not, but they emphasized that it is a problem and it was my understanding that they are also trying to solve that issue with their ML technique.Response: see point 5 suggestions/major concerns, below.
Suggestions/major concerns: 1) The title of the manuscript is about cell counting and trypan blue assay.Thus, the introduction should start by introducing state-of-the art cell counting and any issues with the measurements that the authors are aiming to solve.I was lost how for a bit reading about protein expression etc since they didn't link it to cell counting until the fourth paragraph.Response: We thank the reviewer for pointing out the need to emphasize the most critical message in the introduction.In response to the reviewer's valuable feedback, we have significantly reduced the introduction by omitting unnecessary explanations of the expression platforms, which did not contribute substantially to the manuscript.We have condensed and summarized the text while retaining essential references to allow readers to access underlying information related to the platforms.Additionally, we have relocated the section that elaborates on the determination of cell lysis to the discussion.
2) Figure 1, Machine learning approach, it is unclear what is the sample.Did the authors use a hemocytometer and brightfield images for the analysis or the chambers for automated cell counters.Later the information can be found in the methods, but Fig. 1 comes earlier than the explanation.I suggest adding at least a cartoon image of the slide+microscope to the ML method part like for the others.Response: We express our gratitude to the reviewer for providing valuable feedback regarding the need for further clarification of Figure 1 and the overall approach.In response to the reviewer's suggestion, we have updated Figure 1 to clearly illustrate that both the automated cell counters and the machine learning model require a chamber or liquid container with a known volume for accurate cell counting.Moreover, we have carefully considered the reviewer's recommendation to enhance the depiction by including a microscope.Accordingly, we have incorporated a zoom-in into Figure 1 to represent the microscope used in the cell counting process.
Updated Figure 1: 3) For the training of the model, wouldn't it be beneficial to prepare control samples of healthy cultures (with only few dead cells) and 100% dead cell control sample by treating them with a known cell killing methods (e.g.heat-shock or fixation)?Also, for the training of the model, there is disproportion between the live cell # and dead cell #.The ML experts typically tell me that we need to train equal number of instances in each class to avoid imbalances/bias in the training.This limitation is pointed out later on line 260 "For both cell lines jointly, the model was able to detect alive cells (Figure 4A) slightly better than dead cells (Figure 4B), a consequence of their greater consistency in size and shape and the larger number of alive cells in the training data set."Response: We express our gratitude to the reviewer for his/her astute observations that relate to the different aspects used as training data.Although we recognize the prospect of further improving the model's performance through extended training data with more dead cells: • It is noteworthy that the misclassification of dead cells is infrequent.This is exemplified by the highly similar F1 scores for dead and alive cells (Figure 4).Hence, the potential bias stemming from an increased number of viable cells in the training dataset does not appear to significantly impact the performance of the ML model.• We believe that further training may not be necessary, as we wish to underscore that the model exhibits commendable performance, even on cell types it was not originally trained on, such as HEK cells.
4) The model seemed to be validated by visual inspection.However, visual manual approach was criticized earlier in the manuscript.Authors should at least visually verify it with more than one operator.Also, the model could be verified using control 100% dead samples (or other control samples).
Response: We thank the reviewer for pointing out that the visual inspection seems counterintuitive, since it is the problem that we are trying to solve.We agree with the reviewer that a single verification might be insufficient.Therefore, we have incorporated an additional visual manual inspection to exclude substantial operator-to-operator variance.Confusion matrices of all evaluations have been added to the manuscript as supplemental information.The text has been updated accordingly: Line 216 of the revised manuscript: "… to multiple independent manual inspections of all 122 classified …" Also, near-dead samples of the insect cells (viabilities < 20% and < 10% for Hi5 and Sf9) prepared using the reviewer's suggested heat-shock method were already present in the original manuscript.
5) It is not clear to me how did their ML tool fix aggregates issue at high cell densities, which they mention is a problem.How was the model verified since visually it is hard to count how many cells are in an aggregate?Response: We sincerely appreciate the reviewer for bringing up this matter.However, we note that within the paper, we already explicitly acknowledged our inability to address this issue through the ML tool.When cells are significantly aggregated, it is reasonable to expect that the ML model, much like manual or automated cell counters, may encounter challenges in accurately counting them.
We have provided elaboration on this aspect in the manuscript to enhance clarity and understanding: -Line 299 of the revised manuscript: "High accuracies were also achieved by the ML model for dead cell counts for Hi5 (Error!Reference source not found.C) and Sf9 (Error!Reference source not found.D) cells, with a maximum overestimation of ~4.5% for the higher cell counts (>150 cells/FoV), originating from the double counts of aggregated cells.Aggregated cells can result in a significant overestimation of cell counts due to the lack of cell boundary detection, leading to double counts.This is in line with the decreased accuracy observed for heavily aggregated cultures by manual cell counting methods and the majority of automated cell counters."-And line 358 of the revised manuscript: "This allows one to apply the ML model to cell cultures with a high cell density without the need for additional dilution prior to analysis, thus reducing additional experimental error and process time, provided that aggregation is not apparent." 6) I cannot comment on Model Performance section since I am not an expert in ML field.
Response: We thank the reviewer for taking the time and effort to assess the manuscript and evaluate its scientific soundness.
7) Data availability: the authors indicated that references 33 and 40 provide the readers the full ML model, access to evaluated images and training data set.However, Ref. 33 website gives an error "DOI not found" and Ref. 40 is not accessible since it asks for "Delft University of Technology GitLab server" login credentials.
Response: We thank the reviewer for pointing out that both of the repositories are currently unavailable.In response to the reviewer's concerns, we have removed ref 40 from the manuscript.Additionally, we intend to make the code available under the repository referenced in citation 33 of the original manuscript.We regretfully inform the reviewer that we can only publish the repository once the manuscript is accepted, and we obtain the DOI for the publication (which required for publishing the repository).However, we assure the reviewer that we are fully committed to transparency and reproducibility.Therefore, if the reviewer wishes to evaluate the soundness of the code or the ML model in its entirety, we are more than willing to provide all the necessary information and code for his/her assessment.

Reviewer #2
Finding ways to reduce the cost of scientific research without losing its quality is an important task.This is especially true for countries with weak economies, where scientists often do not have access to expensive equipment, including automatic cell counting systems.Based on the results of their research, the authors of the article proposed a convenient, inexpensive method of automatically counting of cells instead of labourintensive manual counting.The positive thing is that the proposed method is universal and can be applied to different types of cell cultures.In general, the manuscript submitted for review makes a good impression.
Response: We thank the reviewer for reviewing our protocol and appreciate the positive evaluation.

Reviewer #3
The manuscript under review introduces Machine Learning (ML) model aimed at providing an efficient alternative to manual or automated cell counting in Trypan blue-stained microscopic images of insect and HEK cells.The model claims to offer higher speed, lower cost, and the capacity to process numerous images swiftly.
It is intended to be beneficial for cell culture operators across all scales and to simplify protein expression requirements in insect cell production platforms.Despite the promising potential of this work, I have identified several areas of the manuscript that could benefit from improvement: Response: We thank the reviewer for reviewing our protocol and appreciate the positive evaluation.We addressed all comments in a point-by-point manner.
1) The manuscript is well-written but the introduction is excessively long and could be better aligned with the main objectives of the study.
Response: We express our gratitude to the reviewer for highlighting the need to prioritize the most important message in the introduction.Please, see point 1 reviewer #1, above.
2) The provided illustration diagram in the article lacks logical reasoning in directly feeding the sample to the machine learning model.To address this issue effectively, it is crucial to integrate a detection mechanism into the process.
Response: We thank the reviewer for highlighting the deficiency in the explanation of the machine learning model.Please, see point 2 reviewer #1, above.
3) Reference [3] seems unrelated to the topic at hand.To improve the article's general coherence, it is advised to reevaluate its relevance or eliminate it.
Response: We thank the reviewer for pointing out that reference [3] was redundant and have eliminated the reference from the manuscript.
4) The ML model that was applied in the study needs to be further explained.It would improve comprehension and provide technical depth to include a detailed discussion of its architecture, important parts, and algorithms.
Response: We express our gratitude to the reviewer for highlighting the absence of comprehensive elucidation concerning the ML model, particularly the underlying YOLOv4 architecture.Our primary objective in crafting the manuscript was to ensure accessibility without delving excessively into the intricacies of the ML domain.Nonetheless, we recognize the possibility of inadvertently alienating readers with an interest in the foundational architecture and algorithms.In agreement with the reviewer's perspective, we concur that the manuscript should indeed encompass a succinct exposition of the model.Accordingly, we have revised the manuscript, in particular in the "Methods" section under the subheading "Baseline ML model".We hope that these revisions address the concerns effectively.
Starting from line 188, the revised manuscript now reads: "The YOLOv4 model consists of three architectural components referred to as the head, neck, and backbone.The backbone is the initial part of the neural network responsible for extracting the feature maps from the input image.In YOLOv4, the backbone is based on the CSPDarknet53 architecture and employs a Cross Stage Partial network (CSPNet) structure to improve information flow and feature extra efficiency in comparison to its predecessor: Darknet53 [22,26].
CSPDarknet53 contains a series of convolutional layers that gradually downsample the input image, capturing features at difference scales and levels of abstraction.The extracted features are then passed to the subsequent stages of the model.The neck is an intermediary component inserted between the backbone and the head of the network.It plays a crucial role in aggregating features from multiple stages of the backbone.In YOLOv4, the neck architecture is designed to enhance feature fusion and information flow.It consists of bottom-up pathways, which capture high-resolution features from different stages of the backbone, and topdown pathways which upsample and fuse these features to create a rich feature representation that is used by the detection head [22,27,28].The head is the final part of the network responsible for predicting object classes and bounding boxes.It takes the fused and aggregated feature maps from the neck and applies additionally convolutional and fully connected layers to predict the presence of objects, their classes, and the corresponding bounding boxes.The head architecture is designed to accurately locate and classify objects in the image" 5) There are difficulties with availability and retrieval in reference [15].Response: We express our gratitude to the reviewer for bringing to our attention the difficulty in retrieving reference [15].We have accordingly revised the citation and provided an alternative reference that conveys the same point while being more readily accessible.
6) The methodology section (lines 143 to 145) lacks clarity on how the cell counts in the training and validation sets were determined.
Response: We thank the reviewer for bringing this to our attention.To address this concern, we have included the term "manually" in the manuscript to clarify that the classification of cells in the ML training and validation data sets requires human intervention.This process of assigning the labels "dead" or "alive" manually, is a prerequisite for the ML model construction process.Despite the manual assessment of cell status, we are confident that the large number of cells used in the training and validation datasets effectively mitigates any bias introduced by the manual classification process.Consequently, the final model's ability to classify cells correctly remains largely unaffected, assuring the reliability of the results.